package com.jlpay.openapi.demo.openmerch.bill;

import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import main.java.com.jlpay.open.jlpay.sdk.java.model.openmerch.bill.request.OrderInfoQueryRequest;
import main.java.com.jlpay.open.jlpay.sdk.java.model.openmerch.bill.response.OrderInfoQueryResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author liaochangyi
 * @date 2025-08-14  10:55
 */
public class OrderInfoQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(OpenBillDownloadQueryService.class);

    public static void main(String[] args) {
        OrderInfoQueryRequest request = buildOrderInfoQueryRequest();
        OrderInfoQueryResponse response = JlpayOpenApiService.openMerchService()
                .post(request, OrderInfoQueryResponse.class);
        LOGGER.info("订单信息查询结果:{}", JsonUtils.toString(response));
    }

    private static OrderInfoQueryRequest buildOrderInfoQueryRequest() {
        OrderInfoQueryRequest request = new OrderInfoQueryRequest();
        request.setOrderId("421128646490446528512078");
        return request;
    }
}
